//
//  CinemaController.m
//  statistiscData
//
//  Created by zhaochengfeng on 2016/12/21.
//  Copyright © 2016年 bmwl. All rights reserved.
//

#import "CinemaController.h"
#import "CinemaCell.h"
#import "CinemaHeader.h"

@interface CinemaController ()<UITableViewDelegate,UITableViewDataSource>

@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic, strong) CinemaHeader *header;

@end

@implementation CinemaController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"影院";
    self.tableView.tableHeaderView = self.header;
    [self.tableView registerNib:[UINib nibWithNibName:CinemaCellID bundle:nil] forCellReuseIdentifier:CinemaCellID];
    
}

- (CinemaHeader *)header{
    if (_header == nil) {
        _header = [CinemaHeader createViewFromNib];
    }
    return _header;
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    CinemaCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CinemaCellID forIndexPath:indexPath];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return [CinemaCell cinemaCellHeight];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
